//
//  HRZSearchCollectionViewCell.m
//  EMarket
//
//  Created by 石头 on 2018/5/31.
//  Copyright © 2018 好日子. All rights reserved.
//

#import "HRZSearchCollectionViewCell.h"

@implementation HRZSearchCollectionViewCell
+ (CGSize)getSizeWithText:(NSString *)text {
    NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
    style.lineBreakMode = NSLineBreakByCharWrapping;
    CGSize size = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 24) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12.0f], NSParagraphStyleAttributeName:style} context:nil].size;
    return CGSizeMake(size.width + 20, 24);
}
- (IBAction)onContentButtonClick:(id)sender {
    if ([self.delegate respondsToSelector:@selector(selectButtonClick:)]) {
        [self.delegate selectButtonClick:self];
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [_contentButton.layer setMasksToBounds:YES];
    [_contentButton.layer setCornerRadius:12.0];
    [_contentButton setBackgroundColor:[UIColor colorWithWhite:0.957 alpha:1.000]];
}

@end
